﻿using System;
using System.Collections.Generic;
using System.Text;

namespace eduSrc.Models
{
    public class ArticleType
    {
        public Dictionary<string, string> AtcType = new Dictionary<string, string>();
        public Dictionary<string, string> AtcDomain = new Dictionary<string, string>();

        public Dictionary<string, string> AtcUriRoot = new Dictionary<string, string>();

        public Dictionary<string, string> AtcKeyword = new Dictionary<string, string>();
        public Dictionary<string, string> AtcCategory = new Dictionary<string, string>();
        public Dictionary<string, string> AtcCategoryShort = new Dictionary<string, string>();

        public ArticleType()
        {
            AtcType.Add("M_ChengKao", "Educ");
            AtcType.Add("M_GCT", "Educ");
            AtcType.Add("M_MBA", "Educ");
            AtcType.Add("M_KaoYan", "Educ");
            AtcType.Add("M_FaShuo", "Educ");
            AtcType.Add("M_Art", "Educ");
            AtcType.Add("M_Educate", "Educ");

            AtcType.Add("M_KuaiJi", "Fina");
            AtcType.Add("M_CPA", "Fina");
            AtcType.Add("M_Econ", "Fina");
            AtcType.Add("M_TaxAcc", "Fina");
            AtcType.Add("M_Eval", "Fina");
            AtcType.Add("M_Bank", "Fina");
            AtcType.Add("M_SAcc", "Fina");

            AtcType.Add("M_Offi", "Qual");
            AtcType.Add("M_Decl", "Qual");
            AtcType.Add("M_Tour", "Qual");
            AtcType.Add("M_SiFa", "Qual");
            AtcType.Add("M_Huma", "Qual");
            AtcType.Add("M_Exam", "Qual");
            AtcType.Add("M_Mentality", "Qual");
            AtcType.Add("M_English", "Qual");
            AtcType.Add("M_PropMgt", "Qual");

            AtcType.Add("M_Buil", "Engi");
            AtcType.Add("M_Adju", "Engi");
            AtcType.Add("M_Fabr", "Engi");
            AtcType.Add("M_Supe", "Engi");
            AtcType.Add("M_Safe", "Engi");
            AtcType.Add("M_Advi", "Engi");
            AtcType.Add("M_Arch", "Engi");

            //------------------------------------------------------------

            AtcDomain.Add("M_ChengKao", "http://ck.kaoyee.com/");
            AtcDomain.Add("M_GCT", "http://gct.kaoyee.com/");
            AtcDomain.Add("M_MBA", "http://mba.kaoyee.com/");
            AtcDomain.Add("M_KaoYan", "http://ky.kaoyee.com/");
            AtcDomain.Add("M_FaShuo", "http://fs.kaoyee.com/");
            AtcDomain.Add("M_Art", "http://ys.kaoyee.com/");
            AtcDomain.Add("M_Educate", "http://js.kaoyee.com/");

            AtcDomain.Add("M_KuaiJi", "http://kj.kaoyee.com/");
            AtcDomain.Add("M_CPA", "http://cpa.kaoyee.com/");
            AtcDomain.Add("M_Econ", "http://jjs.kaoyee.com/");
            AtcDomain.Add("M_TaxAcc", "http://sws.kaoyee.com/");
            AtcDomain.Add("M_Eval", "http://pgs.kaoyee.com/");
            AtcDomain.Add("M_Bank", "http://yh.kaoyee.com/");
            AtcDomain.Add("M_SAcc", "http://zq.kaoyee.com/");

            AtcDomain.Add("M_Offi", "http://gwy.kaoyee.com/");
            AtcDomain.Add("M_Decl", "http://bgy.kaoyee.com/");
            AtcDomain.Add("M_Tour", "http://dyy.kaoyee.com/");
            AtcDomain.Add("M_SiFa", "http://sf.kaoyee.com/");
            AtcDomain.Add("M_Huma", "http://hr.kaoyee.com/");
            AtcDomain.Add("M_Exam", "http://wl.kaoyee.com/");
            AtcDomain.Add("M_Mentality", "http://xl.kaoyee.com/");
            AtcDomain.Add("M_English", "http://english.kaoyee.com/");
            AtcDomain.Add("M_PropMgt", "http://wy.kaoyee.com/");

            AtcDomain.Add("M_Buil", "http://yj.kaoyee.com/");
            AtcDomain.Add("M_Adju", "http://ej.kaoyee.com/");
            AtcDomain.Add("M_Fabr", "http://zjs.kaoyee.com/");
            AtcDomain.Add("M_Supe", "http://jls.kaoyee.com/");
            AtcDomain.Add("M_Safe", "http://aqs.kaoyee.com/");
            AtcDomain.Add("M_Advi", "http://zxs.kaoyee.com/");
            AtcDomain.Add("M_Arch", "http://zls.kaoyee.com/");


            AtcUriRoot.Add("M_ChengKao", "http://ck.kaoyee.com/Educ/ChengKao/");
            AtcUriRoot.Add("M_GCT", "http://gct.kaoyee.com/Educ/GCT/");
            AtcUriRoot.Add("M_MBA", "http://mba.kaoyee.com/Educ/MBA/");
            AtcUriRoot.Add("M_KaoYan", "http://ky.kaoyee.com/Educ/KaoYan/");
            AtcUriRoot.Add("M_FaShuo", "http://fs.kaoyee.com/Educ/FaShuo/");
            AtcUriRoot.Add("M_Art", "http://ys.kaoyee.com/Educ/Art/");
            AtcUriRoot.Add("M_Educate", "http://js.kaoyee.com/Educ/Educate/");

            AtcUriRoot.Add("M_KuaiJi", "http://kj.kaoyee.com/Fina/KuaiJi/");
            AtcUriRoot.Add("M_CPA", "http://cpa.kaoyee.com/Fina/CPA/");
            AtcUriRoot.Add("M_Econ", "http://jjs.kaoyee.com/Fina/Econ/");
            AtcUriRoot.Add("M_TaxAcc", "http://sws.kaoyee.com/Fina/TaxAcc/");
            AtcUriRoot.Add("M_Eval", "http://pgs.kaoyee.com/Fina/Eval/");
            AtcUriRoot.Add("M_Bank", "http://yh.kaoyee.com/Fina/Bank/");
            AtcUriRoot.Add("M_SAcc", "http://zq.kaoyee.com/Fina/SAcc/");

            AtcUriRoot.Add("M_Offi", "http://gwy.kaoyee.com/Qual/Offi/");
            AtcUriRoot.Add("M_Decl", "http://bgy.kaoyee.com/Qual/Decl/");
            AtcUriRoot.Add("M_Tour", "http://dyy.kaoyee.com/Qual/Tour/");
            AtcUriRoot.Add("M_SiFa", "http://sf.kaoyee.com/Qual/SiFa/");
            AtcUriRoot.Add("M_Huma", "http://hr.kaoyee.com/Qual/Huma/");
            AtcUriRoot.Add("M_Exam", "http://wl.kaoyee.com/Qual/Exam/");
            AtcUriRoot.Add("M_Mentality", "http://xl.kaoyee.com/Qual/Mentality/");
            AtcUriRoot.Add("M_English", "http://english.kaoyee.com/Qual/English/");
            AtcUriRoot.Add("M_PropMgt", "http://wy.kaoyee.com/Qual/PropMgt/");

            AtcUriRoot.Add("M_Buil", "http://yj.kaoyee.com/Engi/Buil/");
            AtcUriRoot.Add("M_Adju", "http://ej.kaoyee.com/Engi/Adju/");
            AtcUriRoot.Add("M_Fabr", "http://zjs.kaoyee.com/Engi/Fabr/");
            AtcUriRoot.Add("M_Supe", "http://jls.kaoyee.com/Engi/Supe/");
            AtcUriRoot.Add("M_Safe", "http://aqs.kaoyee.com/Engi/Safe/");
            AtcUriRoot.Add("M_Advi", "http://zxs.kaoyee.com/Engi/Advi/");
            AtcUriRoot.Add("M_Arch", "http://zls.kaoyee.com/Engi/Arch/");

            //------------------------------------------------------------

            AtcKeyword.Add("ChengKao", "ck");
            AtcKeyword.Add("GCT", "gct");
            AtcKeyword.Add("MBA", "mba");
            AtcKeyword.Add("KaoYan", "ky");
            AtcKeyword.Add("FaShuo", "fs");
            AtcKeyword.Add("Art", "ys");
            AtcKeyword.Add("Educate", "js");

            AtcKeyword.Add("KuaiJi", "kj");
            AtcKeyword.Add("CPA", "cpa");
            AtcKeyword.Add("Econ", "jjs");
            AtcKeyword.Add("TaxAcc", "sws");
            AtcKeyword.Add("Eval", "pgs");
            AtcKeyword.Add("Bank", "yh");
            AtcKeyword.Add("SAcc", "zq");

            AtcKeyword.Add("Offi", "gwy");
            AtcKeyword.Add("Decl", "bgy");
            AtcKeyword.Add("Tour", "dyy");
            AtcKeyword.Add("SiFa", "sf");
            AtcKeyword.Add("Huma", "hr");
            AtcKeyword.Add("Exam", "wl");
            AtcKeyword.Add("Mentality", "xl");
            AtcKeyword.Add("English", "english");
            AtcKeyword.Add("PropMgt", "wy");

            AtcKeyword.Add("Buil", "yj");
            AtcKeyword.Add("Adju", "ej");
            AtcKeyword.Add("Fabr", "zjs");
            AtcKeyword.Add("Supe", "jls");
            AtcKeyword.Add("Safe", "aqs");
            AtcKeyword.Add("Advi", "zxs");
            AtcKeyword.Add("Arch", "zls");

            AtcKeyword.Add("Curricula", "ms");
            AtcKeyword.Add("EClass", "wx");
            //------------------------------------------------------------

            AtcCategory.Add("M_ChengKao", "成人高考");
            AtcCategory.Add("M_GCT", "GCT考试");
            AtcCategory.Add("M_MBA", "MBA联考");
            AtcCategory.Add("M_KaoYan", "考研");
            AtcCategory.Add("M_FaShuo", "法律硕士联考");
            AtcCategory.Add("M_Art", "艺术硕士联考");
            AtcCategory.Add("M_Educate", "教育硕士联考");

            AtcCategory.Add("M_KuaiJi", "会计职称考试");
            AtcCategory.Add("M_CPA", "注册会计师考试");
            AtcCategory.Add("M_Econ", "经济师考试");
            AtcCategory.Add("M_TaxAcc", "注册税务师考试");
            AtcCategory.Add("M_Eval", "资产评估师考试");
            AtcCategory.Add("M_Bank", "银行从业资格考试");
            AtcCategory.Add("M_SAcc", "证券从业资格考试");

            AtcCategory.Add("M_Offi", "公务员考试");
            AtcCategory.Add("M_Decl", "报关员考试");
            AtcCategory.Add("M_Tour", "导游考试");
            AtcCategory.Add("M_SiFa", "司法考试");
            AtcCategory.Add("M_Huma", "人力资源师考试");
            AtcCategory.Add("M_Exam", "物流师考试");
            AtcCategory.Add("M_Mentality", "心理咨询师考试");
            AtcCategory.Add("M_English", "职称英语考试");
            AtcCategory.Add("M_PropMgt", "物业管理考试");

            AtcCategory.Add("M_Buil", "一级建造师考试");
            AtcCategory.Add("M_Adju", "二级建造师考试");
            AtcCategory.Add("M_Fabr", "造价师考试");
            AtcCategory.Add("M_Supe", "监理师考试");
            AtcCategory.Add("M_Safe", "安全师考试");
            AtcCategory.Add("M_Advi", "咨询师考试");
            AtcCategory.Add("M_Arch", "质量师考试");

            //------------------------------------------------------------

            AtcCategoryShort.Add("M_ChengKao", "成人高考");
            AtcCategoryShort.Add("M_GCT", "GCT 考试");
            AtcCategoryShort.Add("M_MBA", "MBA 联考");
            AtcCategoryShort.Add("M_KaoYan", "普通考研");
            AtcCategoryShort.Add("M_FaShuo", "法律硕士");
            AtcCategoryShort.Add("M_Art", "艺术硕士");
            AtcCategoryShort.Add("M_Educate", "教育硕士");

            AtcCategoryShort.Add("M_KuaiJi", "会计职称");
            AtcCategoryShort.Add("M_CPA", "CPA 考试");
            AtcCategoryShort.Add("M_Econ", "经 济 师");
            AtcCategoryShort.Add("M_TaxAcc", "税 务 师");
            AtcCategoryShort.Add("M_Eval", "评 估 师");
            AtcCategoryShort.Add("M_Bank", "银行从业");
            AtcCategoryShort.Add("M_SAcc", "证券资格");

            AtcCategoryShort.Add("M_Offi", "公 务 员");
            AtcCategoryShort.Add("M_Decl", "报 关 员");
            AtcCategoryShort.Add("M_Tour", "导 游 员");
            AtcCategoryShort.Add("M_SiFa", "司法考试");
            AtcCategoryShort.Add("M_Huma", "人力资源");
            AtcCategoryShort.Add("M_Exam", "物流管理");
            AtcCategoryShort.Add("M_Mentality", "心理咨询");
            AtcCategoryShort.Add("M_English", "职称英语");
            AtcCategoryShort.Add("M_PropMgt", "物业管理");

            AtcCategoryShort.Add("M_Buil", "一级建造");
            AtcCategoryShort.Add("M_Adju", "二级建造");
            AtcCategoryShort.Add("M_Fabr", "造 价 师");
            AtcCategoryShort.Add("M_Supe", "监 理 师");
            AtcCategoryShort.Add("M_Safe", "安 全 师");
            AtcCategoryShort.Add("M_Advi", "咨 询 师");
            AtcCategoryShort.Add("M_Arch", "质 量 师");

        }

        public string GetCategoryShort(string moduleCn)
        {
            foreach (KeyValuePair<string, string> pair in AtcCategoryShort)
            {
                if (pair.Key.ToLower() == moduleCn.ToLower())
                {
                    return pair.Value;
                }
            }
            return "考易网";
        }

        public string GetCategory(string moduleCn)
        {
            foreach (KeyValuePair<string, string> pair in AtcCategory)
            {
                if (pair.Key.ToLower() == moduleCn.ToLower())
                {
                    return pair.Value;
                }
            }
            return "考易网";
        }

        public string GetKeywordType(string type)
        {
            foreach (KeyValuePair<string, string> pair in AtcKeyword)
            {
                if (pair.Key.ToLower() == type.ToLower() || pair.Value.ToLower() == type.ToLower())
                {
                    return pair.Key.ToLower();
                }
            }
            return string.Empty;
        }

        public string GetKeywordTypeByArray(string[] arr)
        {
            foreach (string s in arr)
            {
                string t = GetKeywordType(s);
                if (!string.IsNullOrEmpty(t))
                {
                    return t;
                }
            }
            return string.Empty;
        }

        public string GetArticleType(string type)
        {
            string t = string.Empty;
            if (AtcType.TryGetValue(type, out t))
            {
                return t;
            }
            return "Unknown";
        }

        public string GetArticleDomain(string type)
        {
            string t = string.Empty;
            if (AtcDomain.TryGetValue(type, out t))
            {
                return t;
            }
            return "Unknown";
        }

        public string GetUriRootByModuleCn(string type)
        {
            string t = string.Empty;
            if (AtcUriRoot.TryGetValue(type, out t))
            {
                return t;
            }
            return "Unknown";
        }
    }
}
